home *** CD-ROM | disk | FTP | other *** search
- Path: news.uh.edu!usenet
- From: Sensarn <txs53132@bayou.uh.edu>
- Newsgroups: comp.lang.c++
- Subject: Help -- File Input
- Date: 21 Jan 1996 04:15:02 GMT
- Organization: AEtna Insurance Agency
- Message-ID: <4dsek6$m0k@masala.cc.uh.edu>
- NNTP-Posting-Host: sip-14278.public-dialups.uh.edu
- Mime-Version: 1.0
- Content-Type: text/plain; charset=us-ascii
- Content-Transfer-Encoding: 7bit
- X-Mailer: Mozilla 1.1 (Windows; U; 16bit)
-
- I am trying to write a function that reads integers from a file. I
- tried this:
-
- unsigned int fgetint(FILE *fp)
- {
- unsigned char al,ah; //Bytes in my make-believe AX register
- al=(unsigned char)fgetc(fp); //Low byte
- ah=(unsigned char)fgetc(fp); //High byte
- return(ah<<8+al); //Return high byte over low byte
- }
-
- TC++ tells me I cant start a function declaration with FILE. The
- prototype for the fgetc function uses it (by the way -- I #included the
- appropriate header files). How can I do this?
-
- Steven Sensarn - txs53132@bayou.uh.edu
-
-